package cn.wenhaha.lazy;

/**
 * @ClassName: LazeTree
 * @description: TODO 懒汉单例，第三个改进方法
 * @author: wyndem
 * @date: 2019/5/13 12:43
 * @Version: 1.0
 **/
public class LazyThree {

    private static LazyThree lazeTwo;

    private LazyThree() {
    }

    /**
     * description: 每次回去都会被阻塞，执行效率过慢，但是线程安全的
     * @Author wyndem
     * @Date 2019/5/13 12:49
     * @Param []
     * @return cn.wenhaha.lazy.LazyThree
     **/
    public static synchronized LazyThree getInstance(){
        if (lazeTwo==null){
            lazeTwo=new LazyThree();
        }
        return lazeTwo;
    }

}
